package com.mackyhuang.annotated.enhancer.proxy;

import com.mackyhuang.annotated.common.CommonConstant;

/**
 * @description:
 * @author: mackyHuang
 * @create: 2021/01/05
 */
public class ProxyFactory {

    private static ProxyFactory instance = new ProxyFactory();

    private ProxyFactory() {

    }

    public static ProxyFactory getInstance() {
        return instance;
    }

    public Proxy getProxy(String proxy) {
        if (CommonConstant.CGLIB.equals(proxy)) {
            return new CGlibProxy();
        } else {
            return new JDKProxy();
        }
    }
}
